// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 修改参数配置 PUT /api/system/config */
export async function configEditUsingPUT(body: API.SysConfig, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/config', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增参数配置 POST /api/system/config */
export async function configAddUsingPOST(body: API.SysConfig, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/config', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除参数配置 DELETE /api/system/config/${param0} */
export async function configRemoveUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.configRemoveUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { configIds: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/config/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据参数编号获取详细信息 GET /api/system/config/${param0} */
export async function configGetInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.configGetInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { configId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/config/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据参数键名查询参数值 GET /api/system/config/configKey/${param0} */
export async function configGetConfigKeyUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.configGetConfigKeyUsingGETParams,
  options?: { [key: string]: any },
) {
  const { configKey: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/config/configKey/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导出参数配置列表 POST /api/system/config/export */
export async function configExportUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.configExportUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/system/config/export', {
    method: 'POST',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 获取参数配置列表 GET /api/system/config/list */
export async function configListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.configListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/system/config/list', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 刷新参数缓存 DELETE /api/system/config/refreshCache */
export async function configRefreshCacheUsingDELETE(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/config/refreshCache', {
    method: 'DELETE',
    ...(options || {}),
  });
}
